home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Demoversionen / Anwendungen / PFS3_5153 / Install next >
Text File  |  2000-05-16  |  8KB  |  416 lines

  1. ; Installer script for Professional File System 3
  2. ; (c) 1999 GREat Effects Development
  3. ;
  4.  
  5. (transcript "Professional File System 3 to 3.3 Upgrade")
  6.  
  7. (procedure update_tool #updatefile
  8.   (set #current (tackon #tooldir #updatefile))
  9.   (if (exists #current)
  10.     ( (delete #current (optional "force"))
  11.       (do_patch
  12.         (tackon "patch" (cat #updatefile ".pch"))
  13.         (tackon (tackon #sourceroot "tools") #updatefile)
  14.         #current
  15.       )
  16.     )
  17.   )
  18. )
  19.  
  20. (procedure update_doc #updatefile
  21.   (set #current (tackon #docdir #updatefile))
  22.   (if (exists #current)
  23.     ( (delete #current (optional "force"))
  24.       (do_patch
  25.         (tackon "patch" (tackon #language (cat #updatefile ".pch")))
  26.         (tackon (tackon #sourcemain "docs") #updatefile)
  27.         #current
  28.       )
  29.     )
  30.   )
  31. )
  32.  
  33. ; check upgrade
  34. (procedure pfs_upgrade
  35.   (message "This is the PFS2 to PFS3 upgrade version of PFS3. To "
  36.         "install this upgrade the PFS2 files need to be installed "
  37.         "in the l: directory. If you no longer have these files, "
  38.         "they can be recreated by running the install script on "
  39.         "your PFS2 CD. This does not effect you current PFS3 "
  40.         "installation. "
  41.         "NOTE: just run install, do NOT edit your RDB or format "
  42.         "any disks!"
  43.   )
  44.   (if (or (exists "l:pfs2") 
  45.         (or (exists "l:pfs2ds") 
  46.           (or (exists "l:mupfs2") (exists "l:mupfs2ds"))))
  47.     (
  48.      (while (= 0 (BITAND #licence 16))
  49.       (set #cdkey2
  50.         (asknumber
  51.           (prompt "Upgrade: Please enter the PFS2 CD-key")
  52.           (help (cat "The CD-Key is the number on the sticker on the front of the CD case."
  53.                 "The PFS2 key is expected here, not the PFS3 key")
  54.           )
  55.           (default 0)
  56.         )
  57.       )
  58.       (set #licence 
  59.         (run "pfs3:c/getserial" #cdkey #cdkey2)
  60.       )
  61.       (if (= 0 (BITAND #licence 16))
  62.         (message "Invalid CD-Key")
  63.       )
  64.      )
  65.     )
  66.     (abort "PFS2 is not installed"
  67.     )
  68.   )
  69. )
  70.  
  71.  
  72. (procedure install_fs #installfile #sourcefile #help
  73.   (set #current (tackon "l:" #installfile))
  74.   (if (exists #current)
  75.     (delete #current (optional "force"))
  76.   )
  77.   (do_patch
  78.     (cat (tackon "patch" (tackon #language #sourcefile)) ".pch")
  79.     (tackon (tackon #sourcemain "fs") #sourcefile)
  80.     #current
  81.   )
  82.  
  83.   (protect #installfile 0)
  84.  
  85.   (set #ok 0)
  86.   (while (= #ok 0)
  87.     (set #rc
  88.       (run "pfs3:c/getserial" #cdkey #cdkey2 (tackon "l:" #installfile) #username)
  89.     )
  90.     
  91.     (if (= #rc 4)
  92.       (pfs_upgrade)
  93.     )
  94.  
  95.     (if (= #rc 3)
  96.       (abort "Installation failed")
  97.     )
  98.  
  99.     (if (= #rc 2)
  100.       (set #ok 1)
  101.     )
  102.   )
  103. )
  104.  
  105. (procedure do_patch #patchfile #source #dest
  106.   (if (exists #source)
  107.     ( (set #temp (tackon "t:" (fileonly #dest)))
  108.       (if (= 0 (run "pfs3:c/spatch" (cat "-o" #temp) (cat "-p" #patchfile) #source
  109.           (prompt "Patching " #source)))
  110.         ( (copyfiles
  111.             (prompt (cat "Upgrading " #dest))
  112.             (source #temp)
  113.             (dest (pathonly #dest))
  114.             (newname (fileonly #dest))
  115.             (optional "force")
  116.           )
  117.           (delete #temp (optional "force"))
  118.            )
  119.         (abort #dest " could not be patched. "
  120.         )
  121.         )
  122.     )
  123.     (abort (fileonly #source) " not found")
  124.   )
  125. )
  126.  
  127. ;-----------------------
  128. ; Welcome
  129. ;
  130. (welcome "Welcome to the Professional File System 3 Upgrade Installation"
  131. )
  132.  
  133. ;-----------------------
  134. ; Get pfs3 disk
  135. ;
  136. (while (not (exists "pfs3:" (noreq)))
  137.   (message "Please insert your original PFS3 CD"
  138.     (all)
  139.   )
  140. )
  141.  
  142. ;-----------------------
  143. ; Ask for serial number
  144. ;
  145. (set #tmp @user-level)
  146. (set #licence 0)
  147. (set #cdkey2 0)
  148. (if (= @user-level 0)
  149.   (user 1)
  150. )
  151. (while (= #licence 0)
  152.   (set #username
  153.     (askstring
  154.         (prompt "Please enter your full name")
  155.         (help "To register PFS3 your name is needed")
  156.     )
  157.   )
  158.  
  159.   (set #cdkey
  160.     (asknumber
  161.         (prompt "Please enter your CD-key")
  162.         (help "The CD-Key is the number on the sticker at the back of the CD case.")
  163.         (default 0)
  164.     )
  165.   )
  166.  
  167.   (set #licence 
  168.     (run "pfs3:c/getserial" #cdkey)
  169.   )
  170.  
  171.   (if (= #licence 0)
  172.     (message "Invalid CD-Key")
  173.   )
  174. )
  175.  
  176. ;--------------------------
  177. ; upgrade
  178. ;
  179. (if (<> 0 (BITAND #licence 8))
  180.   (pfs_upgrade)
  181. )
  182.  
  183. (set #langnr (BITAND #licence 7)
  184. )
  185.  
  186. (set #language "eng"
  187. )
  188.  
  189. (if (= #langnr 2)
  190.   ( 
  191.     (set #language "ger")
  192.     (message "Key accepted. Installing German version"
  193.       (all)
  194.     )
  195.   )
  196. )
  197.  
  198. (if (= #langnr 3)
  199.   ( 
  200.     (set #language "fra")
  201.     (message "Key accepted. Installing French version"
  202.       (all)
  203.     )
  204.   )
  205. )
  206.  
  207. (if (= #langnr 4)
  208.   (
  209.     (set #language "ita")
  210.     (message "Key accepted. Installing Italian version"
  211.       (all)
  212.     )
  213.   )
  214. )
  215.  
  216. (if (= #langnr 1)
  217.   (
  218.     (set #language "eng")
  219.  
  220.     (if (> @user-level 1)
  221.       (
  222.         (set #langnr
  223.           (askchoice
  224.             (prompt "Which language do you prefer")
  225.              (help @askchoice-help) 
  226.             (choices
  227.               "English"
  228.               "Italian"
  229.              )
  230.              (default 0)
  231.            )
  232.         )
  233.          (if (= #langnr 1)
  234.            (set #language "ita")
  235.          )
  236.       )
  237.     )
  238.   )
  239. )
  240.  
  241. (user #tmp)
  242.  
  243. ;--------------------------
  244. ; Some defaults
  245. ;
  246. (set #sourceroot "pfs3:")
  247. (set #sourcemain (tackon #sourceroot (tackon "data/" #language)))
  248.  
  249. ;--------------------------
  250. ; Ask where V5 is installed
  251. ;
  252. (set #destdir "Workbench:tools/pfs3")
  253. (set #destdir
  254.   (askdir
  255.     (prompt "Select the directory where PFS3 5.0 "
  256.           "documentation and tools are installed. ")
  257.     (help    @askdir-help)
  258.     (default #destdir)
  259.   )
  260. )
  261. (while (not (exists #destdir))
  262.   (set #destdir
  263.     (askdir
  264.       (prompt "Select the directory where PFS2 5.0 "
  265.               "documentation and tools are installed. ")
  266.       (help    @askdir-help)
  267.       (default #destdir)
  268.     )
  269.   )
  270. )
  271.  
  272. (set @default-dest #destdir)
  273.                 
  274. (set #docdir (tackon #destdir "doc"))
  275. (set #tooldir (tackon #destdir "tools"))
  276.  
  277. ;--------------------------
  278. ; Get CPU
  279. ;
  280. (set cpu_any    0)
  281. (set cpu_68020    1)
  282. (set cpu_68040    2)
  283. (set cpu_68060    3)
  284. (set #cpu 0)
  285. (set #cputext (database "cpu"))
  286. (if (patmatch "68000|68010" #cputext) (set #cpu cpu_any))
  287. (if (patmatch "68020|68030" #cputext) (set #cpu cpu_68020))
  288. (if (patmatch "68040" #cputext) (set #cpu cpu_68040))
  289. (if (patmatch "68060" #cputext) (set #cpu cpu_68060))
  290.  
  291. ; Ask expert user for CPU
  292. (if (> @user-level 1)
  293.   (set #cpu
  294.     (askchoice 
  295.       (prompt
  296.         (cat "Select for which processor you would like to install: " #cputext))
  297.       (help @askchoice-help) 
  298.       (choices
  299.         "For 68000 Or 68010"
  300.            "For 68020 Or 68030"
  301.         "For 68040"
  302.         "For 68060"
  303.       )
  304.       (default #cpu)
  305.     )
  306.   )
  307. )
  308.  
  309. (set #cpuext "");
  310. (if (= #cpu cpu_68020) (set #cpuext "-020"))
  311. (if (= #cpu cpu_68040) (set #cpuext "-040"))
  312. (if (= #cpu cpu_68060) (set #cpuext "-060"))
  313.  
  314. ;-------------------------
  315. ; Get filesystem options
  316. ;
  317. (set mask_normal    1)
  318. (set mask_ds        2)
  319. (set mask_multiuser 4)
  320. (set mask_dsmultiuser 8)
  321. (set #fs_options -1)
  322. (if (not (exists "libs:multiuser.library"))
  323.   (set #fs_options 
  324.     (BITAND #fs_options (BITNOT (BITOR mask_multiuser mask_dsmultiuser)))
  325.   )
  326. )
  327. (if (> @user-level 1)
  328.   (set #fs_options
  329.      (askoptions
  330.       (prompt "Select which versions you would like to install:")
  331.       (help @askoptions-help)
  332.       (choices
  333.         "Normal version"
  334.         "DirectScsi version"
  335.         "Multiuser version"
  336.         "DirectScsi Multiuser version"
  337.       )
  338.     )
  339.   )
  340. )
  341.  
  342. ;-------------------------
  343. ; Install PFS3
  344. ;
  345. (if (<> 0 (BITAND #fs_options mask_normal))
  346.   ( (install_fs
  347.       "pfs3"
  348.       (cat "PFS3" #cpuext)
  349.       "Installation of default version"
  350.     )
  351.   )
  352. )
  353.  
  354. ;-------------------------
  355. ; Install PFS3ds
  356. ;
  357. (if (<> 0 (BITAND #fs_options mask_ds))
  358.   ( (install_fs
  359.       "pfs3ds"
  360.       (cat "PFS3" #cpuext "ds")
  361.       "Installation of direct scsi version"
  362.     )
  363.   )
  364. )
  365.  
  366.  
  367. ;-------------------------
  368. ; Install muPFS3
  369. ;
  370. (if (<> 0 (BITAND #fs_options mask_multiuser))
  371.   ( (install_fs
  372.       "mupfs3"
  373.       (cat "muPFS3" #cpuext)
  374.       "Installation of multiuser version"
  375.     )
  376.   )
  377. )
  378.  
  379. ;-------------------------
  380. ; Install muPFS2ds
  381. ;
  382. (if (<> 0 (BITAND #fs_options mask_dsmultiuser))
  383.   ( (install_fs
  384.       "mupfs3ds"
  385.       (cat "muPFS3" #cpuext "ds")
  386.       "Installation of direct scsi multiuser version"
  387.     )
  388.   )
  389. )
  390.  
  391.  
  392. ;-------------------------
  393. ; Update Tools
  394. ;
  395. (update_tool "pfsdoctor")
  396. ; (update_tool "diskvalid")
  397. ; (update_tool "makelink")
  398. ; (update_tool "makerollover")
  399. ; (update_tool "pfs2ls")
  400. ; (update_tool "removedirentry")
  401. ; (update_tool "setrollover")
  402.  
  403. ;-------------------------
  404. ; Update docs
  405. ;
  406. ; (update_doc "diskvalid.guide")
  407. ; (update_doc "pfs2.guide")
  408. ; (update_doc "pfs2.h")
  409. ; (update_doc "pfs2ls.guide")
  410. ; (update_doc "pfs2packets.g